<!DOCTYPE html>
<html><head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    
    <link rel="canonical" href="/android/start-page/">

    <title>
        
        startpage | h-book
        
    </title>

    
    <link href="/css/fontawesome.min.css" rel="stylesheet">

    
    <link rel="stylesheet" href="/css/ace.min.css">

    

    

</head>
<body><nav class="navbar navbar-expand-lg navbar-dark bg-primary shadow sticky-top" id="navbarMain">
    <div class="container">
        <div>
            <a class="navbar-brand" href="/">
                
                h-book
            </a>
        </div>
    </div>
</nav>
<div class="container-fluid">
            <div class="row">

                <div class="docs-sidenav order-0 col-12 col-md-3 col-lg-2 col-xl-2 position-sticky border-right"><nav class="navbar navbar-expand-md navbar-light pl-0">
    <button class="navbar-toggler navbar-toggler-right collapsed" type="button" data-toggle="collapse" data-target="#sidenav-left-collapse" aria-controls="sidenav-left-collapse" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

     <div class="collapse navbar-collapse align-items-start flex-column" id="sidenav-left-collapse">
            <form class="form-inline my-2 my-lg-0 searchbox">
                <input class="form-control mr-sm-2 w-100" data-search-input id="search-by" type="text" placeholder="Search">
            </form>

        

         <ul class="navbar-nav flex-column pt-3">
    <li data-nav-id="/hugo/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/hugo/"><h6>Hugo</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/hugo/init/" class="nav-item my-1">
                
                
                  <a href="/hugo/init/" class="nav-link p-0">
                    init
                  </a>
                
        </li>
        <li data-nav-id="/hugo/add-page/" class="nav-item my-1">
                
                
                  <a href="/hugo/add-page/" class="nav-link p-0">
                    add-page
                  </a>
                
        </li>
        <li data-nav-id="/hugo/edit-skill/" class="nav-item my-1">
                
                
                  <a href="/hugo/edit-skill/" class="nav-link p-0">
                    edit-skill
                  </a>
                
        </li>
        <li data-nav-id="/hugo/publish/" class="nav-item my-1">
                
                
                  <a href="/hugo/publish/" class="nav-link p-0">
                    publish
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/android/" class="nav-item my-1 parent haschildren
        ">
        
        
          <a class="nav-link p-0" href="/android/"><h6>Android</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/android/install/" class="nav-item my-1">
                
                
                  <a href="/android/install/" class="nav-link p-0">
                    install
                  </a>
                
        </li>
        <li data-nav-id="/android/create-project/" class="nav-item my-1">
                
                
                  <a href="/android/create-project/" class="nav-link p-0">
                    create project
                  </a>
                
        </li>
        <li data-nav-id="/android/import-material/" class="nav-item my-1">
                
                
                  <a href="/android/import-material/" class="nav-link p-0">
                    import material
                  </a>
                
        </li>
        <li data-nav-id="/android/start-page/" class="nav-item my-1 active">
                
                
                  <a href="/android/start-page/" class="nav-link p-0">
                    startpage
                  </a>
                
        </li>
        <li data-nav-id="/android/i18n/" class="nav-item my-1">
                
                
                  <a href="/android/i18n/" class="nav-link p-0">
                    i18n
                  </a>
                
        </li>
        <li data-nav-id="/android/nav-flat-page/" class="nav-item my-1">
                
                
                  <a href="/android/nav-flat-page/" class="nav-link p-0">
                    nav flat page
                  </a>
                
        </li>
        <li data-nav-id="/android/activity/" class="nav-item my-1">
                
                
                  <a href="/android/activity/" class="nav-link p-0">
                    Activity
                  </a>
                
        </li>
        <li data-nav-id="/android/db/" class="nav-item my-1">
                
                
                  <a href="/android/db/" class="nav-link p-0">
                    DB
                  </a>
                
        </li>
        <li data-nav-id="/android/dialog/" class="nav-item my-1">
                
                
                  <a href="/android/dialog/" class="nav-link p-0">
                    Dialog
                  </a>
                
        </li>
        <li data-nav-id="/android/fragment/" class="nav-item my-1">
                
                
                  <a href="/android/fragment/" class="nav-link p-0">
                    Fragment
                  </a>
                
        </li>
        <li data-nav-id="/android/jetpack/" class="nav-item my-1">
                
                
                  <a href="/android/jetpack/" class="nav-link p-0">
                    Jetpack
                  </a>
                
        </li>
        <li data-nav-id="/android/material/" class="nav-item my-1">
                
                
                  <a href="/android/material/" class="nav-link p-0">
                    Material
                  </a>
                
        </li>
        <li data-nav-id="/android/storage/" class="nav-item my-1">
                
                
                  <a href="/android/storage/" class="nav-link p-0">
                    Storage
                  </a>
                
        </li>
        <li data-nav-id="/android/%E5%9B%BE%E6%A0%87/" class="nav-item my-1">
                
                
                  <a href="/android/%E5%9B%BE%E6%A0%87/" class="nav-link p-0">
                    图标
                  </a>
                
        </li>
        <li data-nav-id="/android/store/" class="nav-item my-1">
                
                
                  <a href="/android/store/" class="nav-link p-0">
                    Store
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/blender/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/blender/"><h6>Blender</h6></a>
        
    </li>
    <li data-nav-id="/bootstrap/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/bootstrap/"><h6>BootStrap</h6></a>
        
    </li>
    <li data-nav-id="/centos7/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/centos7/"><h6>Centos7</h6></a>
        
    </li>
    <li data-nav-id="/dlna/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/dlna/"><h6>DLNA</h6></a>
        
    </li>
    <li data-nav-id="/docker/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/docker/"><h6>Docker</h6></a>
        
    </li>
    <li data-nav-id="/dubbo/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/dubbo/"><h6>Dubbo</h6></a>
        
    </li>
    <li data-nav-id="/ffmpeg/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/ffmpeg/"><h6>FFmpeg</h6></a>
        
    </li>
    <li data-nav-id="/git/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/git/"><h6>Git</h6></a>
        
    </li>
    <li data-nav-id="/gitbook/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/gitbook/"><h6>Gitbook</h6></a>
        
    </li>
    <li data-nav-id="/gitlab/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/gitlab/"><h6>Gitlab</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/gitlab/runner/" class="nav-item my-1">
                
                
                  <a href="/gitlab/runner/" class="nav-link p-0">
                    Runner
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/gradle/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/gradle/"><h6>Gradle</h6></a>
        
    </li>
    <li data-nav-id="/java/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/java/"><h6>Java</h6></a>
        
    </li>
    <li data-nav-id="/jenkins/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/jenkins/"><h6>Jenkins</h6></a>
        
    </li>
    <li data-nav-id="/kubernetes/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/kubernetes/"><h6>Kubernetes</h6></a>
        
    </li>
    <li data-nav-id="/mybatis/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/mybatis/"><h6>Mybatis</h6></a>
        
    </li>
    <li data-nav-id="/mybatis-plus/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/mybatis-plus/"><h6>Mybatis Plus</h6></a>
        
    </li>
    <li data-nav-id="/mysql/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/mysql/"><h6>MySQL</h6></a>
        
    </li>
    <li data-nav-id="/nodejs/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/nodejs/"><h6>Node.js</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/nodejs/npm/" class="nav-item my-1">
                
                
                  <a href="/nodejs/npm/" class="nav-link p-0">
                    NPM
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/postgresql/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/postgresql/"><h6>PostgreSQL</h6></a>
        
    </li>
    <li data-nav-id="/redis/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/redis/"><h6>Redis</h6></a>
        
    </li>
    <li data-nav-id="/samba/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/samba/"><h6>Samba</h6></a>
        
    </li>
    <li data-nav-id="/sql/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/sql/"><h6>SQL</h6></a>
        
    </li>
    <li data-nav-id="/ue5/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/ue5/"><h6>UE5</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/ue5/install/" class="nav-item my-1">
                
                
                  <a href="/ue5/install/" class="nav-link p-0">
                    install
                  </a>
                
        </li>
        <li data-nav-id="/ue5/uninstall/" class="nav-item my-1">
                
                
                  <a href="/ue5/uninstall/" class="nav-link p-0">
                    uninstall
                  </a>
                
        </li>
        <li data-nav-id="/ue5/qa/" class="nav-item my-1">
                
                
                  <a href="/ue5/qa/" class="nav-link p-0">
                    Q&amp;A
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity/"><h6>Unity</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity/install/" class="nav-item my-1">
                
                
                  <a href="/unity/install/" class="nav-link p-0">
                    install
                  </a>
                
        </li>
        <li data-nav-id="/unity/scene/" class="nav-item my-1">
                
                
                  <a href="/unity/scene/" class="nav-link p-0">
                    scene
                  </a>
                
        </li>
        <li data-nav-id="/unity/inspector/" class="nav-item my-1">
                
                
                  <a href="/unity/inspector/" class="nav-link p-0">
                    inspector
                  </a>
                
        </li>
        <li data-nav-id="/unity/assets/" class="nav-item my-1">
                
                
                  <a href="/unity/assets/" class="nav-link p-0">
                    assets
                  </a>
                
        </li>
        <li data-nav-id="/unity/audio-source/" class="nav-item my-1">
                
                
                  <a href="/unity/audio-source/" class="nav-link p-0">
                    audio source
                  </a>
                
        </li>
        <li data-nav-id="/unity/camera/" class="nav-item my-1">
                
                
                  <a href="/unity/camera/" class="nav-link p-0">
                    camera
                  </a>
                
        </li>
        <li data-nav-id="/unity/script/" class="nav-item my-1">
                
                
                  <a href="/unity/script/" class="nav-link p-0">
                    script
                  </a>
                
        </li>
        <li data-nav-id="/unity/prefabs/" class="nav-item my-1">
                
                
                  <a href="/unity/prefabs/" class="nav-link p-0">
                    prefabs
                  </a>
                
        </li>
        <li data-nav-id="/unity/physics/" class="nav-item my-1">
                
                
                  <a href="/unity/physics/" class="nav-link p-0">
                    physics
                  </a>
                
        </li>
        <li data-nav-id="/unity/skybox/" class="nav-item my-1">
                
                
                  <a href="/unity/skybox/" class="nav-link p-0">
                    skybox
                  </a>
                
        </li>
        <li data-nav-id="/unity/particle-system/" class="nav-item my-1">
                
                
                  <a href="/unity/particle-system/" class="nav-link p-0">
                    particle system
                  </a>
                
        </li>
        <li data-nav-id="/unity/shortcut-keys/" class="nav-item my-1">
                
                
                  <a href="/unity/shortcut-keys/" class="nav-link p-0">
                    shortcut keys
                  </a>
                
        </li>
        <li data-nav-id="/unity/qa/" class="nav-item my-1">
                
                
                  <a href="/unity/qa/" class="nav-link p-0">
                    Q&amp;A
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-2d-beginner/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-2d-beginner/"><h6>Unity 2D Beginner</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-2d-beginner/init-and-move/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/init-and-move/" class="nav-link p-0">
                    Init &amp; Move
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/map/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/map/" class="nav-link p-0">
                    Map
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/data/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/data/" class="nav-link p-0">
                    Data
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/animate/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/animate/" class="nav-link p-0">
                    Data
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/bullet/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/bullet/" class="nav-link p-0">
                    Bullet
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/cinemachine/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/cinemachine/" class="nav-link p-0">
                    Cinemachine
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/particle/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/particle/" class="nav-link p-0">
                    Particle
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/ui/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/ui/" class="nav-link p-0">
                    UI
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/npc/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/npc/" class="nav-link p-0">
                    NPC
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/sound/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/sound/" class="nav-link p-0">
                    Sound
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-2d-game-kit/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-2d-game-kit/"><h6>Unity 2D Game Kit</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-2d-game-kit/record/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-game-kit/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-3d-beginner/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-3d-beginner/"><h6>Unity 3D Beginner</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-3d-beginner/init/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/level/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/level/" class="nav-link p-0">
                    Level
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/nav/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/nav/" class="nav-link p-0">
                    Nav
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/render-pipeline/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/render-pipeline/" class="nav-link p-0">
                    Render Pipeline
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/postprocessing/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/postprocessing/" class="nav-link p-0">
                    PostProcessing
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/ui/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/ui/" class="nav-link p-0">
                    UI
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/enemy/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/enemy/" class="nav-link p-0">
                    Enemy
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/sound/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/sound/" class="nav-link p-0">
                    Sound
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/%E5%BB%BA%E6%A8%A1%E5%B7%A5%E5%85%B7/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/%E5%BB%BA%E6%A8%A1%E5%B7%A5%E5%85%B7/" class="nav-link p-0">
                    建模工具
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-arpg/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-arpg/"><h6>Unity ARPG</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-arpg/init/" class="nav-item my-1">
                
                
                  <a href="/unity-arpg/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-arpg/role-state-machine/" class="nav-item my-1">
                
                
                  <a href="/unity-arpg/role-state-machine/" class="nav-link p-0">
                    Role State Machine
                  </a>
                
        </li>
        <li data-nav-id="/unity-arpg/api-piece/" class="nav-item my-1">
                
                
                  <a href="/unity-arpg/api-piece/" class="nav-link p-0">
                    API Piece
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creativecore-animation/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creativecore-animation/"><h6>Unity Creativecore Animation</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creativecore-animation/door/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-animation/door/" class="nav-link p-0">
                    Door
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-animation/init/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-animation/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creativecore-lighting/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creativecore-lighting/"><h6>Unity Creativecore Lighting</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creativecore-lighting/init/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-lighting/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-lighting/outdoor/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-lighting/outdoor/" class="nav-link p-0">
                    Outdoor
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creativecore-shader/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creativecore-shader/"><h6>Unity Creativecore Shader</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creativecore-shader/init/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-shader/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-shader/glass/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-shader/glass/" class="nav-link p-0">
                    Glass
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-shader/shader-graph/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-shader/shader-graph/" class="nav-link p-0">
                    Shader-Graph
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creator-kit-beginner-code/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creator-kit-beginner-code/"><h6>Unity Creator Kit Beginner Code</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creator-kit-beginner-code/record/" class="nav-item my-1">
                
                
                  <a href="/unity-creator-kit-beginner-code/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creator-kit-fps/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creator-kit-fps/"><h6>Unity Creator Kit FPS</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creator-kit-fps/record/" class="nav-item my-1">
                
                
                  <a href="/unity-creator-kit-fps/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-mythirdperson/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-mythirdperson/"><h6>Unity My Third Person</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-mythirdperson/init/" class="nav-item my-1">
                
                
                  <a href="/unity-mythirdperson/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-playground/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-playground/"><h6>Unity Playground</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-playground/record/" class="nav-item my-1">
                
                
                  <a href="/unity-playground/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-ui/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-ui/"><h6>Unity UI</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-ui/init/" class="nav-item my-1">
                
                
                  <a href="/unity-ui/init/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-vfx/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-vfx/"><h6>Unity VFX</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-vfx/init/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/init/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        <li data-nav-id="/unity-vfx/bullet/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/bullet/" class="nav-link p-0">
                    bullet
                  </a>
                
        </li>
        <li data-nav-id="/unity-vfx/rain/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/rain/" class="nav-link p-0">
                    rain
                  </a>
                
        </li>
        <li data-nav-id="/unity-vfx/rock-rain/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/rock-rain/" class="nav-link p-0">
                    Rock Rain
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/vue/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/vue/"><h6>Vue</h6></a>
        
    </li>
    <li data-nav-id="/web/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/web/"><h6>Web</h6></a>
        
    </li>
        </ul>
    </div>
</nav>


</div>
                <div class="docs-toc large order-lg-2 order-md-0 order-xs-1 col-12 col-lg-2 col-xl-2 position-sticky border-left"><div class="docs-toc">
	<nav id="TableOfContents">
  <ul>
    <li><a href="#确认依赖">确认依赖</a></li>
    <li><a href="#新建-activity">新建 Activity</a></li>
    <li><a href="#新建-layout">新建 layout</a></li>
    <li><a href="#新增应用-theme">新增+应用 theme</a></li>
    <li><a href="#创建-recyclerview-逻辑">创建 RecyclerView 逻辑</a></li>
    <li><a href="#补充-startpageactivity-逻辑">补充 StartPageActivity 逻辑</a></li>
    <li><a href="#备注">备注</a></li>
  </ul>
</nav>
</div>
</div>
                <div class="main col-12 order-1 col-md-9 col-lg-10 col-xl-8 py-3">
                

<div class="d-flex flex-column">
    <h1 class="js-title">startpage</h1>
    <div class="d-flex align-items-center">
        
    </div>
</div>

<hr>


<h2 id="确认依赖">确认依赖</h2>
<ul>
<li>ConstraintLayout : 已经由 material 库引入</li>
</ul>
<h2 id="新建-activity">新建 Activity</h2>
<p>StartPageActivity.kt</p>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-kotlin" data-lang="kotlin"><span style="display:flex;"><span><span style="color:#00a8c8">package</span> <span style="color:#111">com.hcindy.hcollection</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">import</span> <span style="color:#111">android.os.Bundle</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">import</span> <span style="color:#111">androidx.appcompat.app.AppCompatActivity</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">class</span> <span style="color:#75af00">StartPageActivity</span> <span style="color:#111">:</span> <span style="color:#111">AppCompatActivity</span><span style="color:#111">()</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">override</span> <span style="color:#00a8c8">fun</span> <span style="color:#75af00">onCreate</span><span style="color:#111">(</span><span style="color:#111">savedInstanceState</span><span style="color:#111">:</span> <span style="color:#111">Bundle</span><span style="color:#111">?)</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">super</span><span style="color:#111">.</span><span style="color:#111">onCreate</span><span style="color:#111">(</span><span style="color:#111">savedInstanceState</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">setContentView</span><span style="color:#111">(</span><span style="color:#75af00">R</span><span style="color:#111">.</span><span style="color:#111">layout</span><span style="color:#111">.</span><span style="color:#111">activity_start_page</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// 先建个最简逻辑，稍后补充
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span><span style="color:#111">}</span>
</span></span></code></pre></div><h2 id="新建-layout">新建 layout</h2>
<p>activity_start_page.xml</p>
<p>RecyclerView 是因为 material.carousel 需要</p>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#75715e">&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;LinearLayout</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">xmlns:android=</span><span style="color:#d88200">&#34;http://schemas.android.com/apk/res/android&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">xmlns:app=</span><span style="color:#d88200">&#34;http://schemas.android.com/apk/res-auto&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">xmlns:tools=</span><span style="color:#d88200">&#34;http://schemas.android.com/tools&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">android:layout_width=</span><span style="color:#d88200">&#34;match_parent&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">android:layout_height=</span><span style="color:#d88200">&#34;match_parent&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">tools:context=</span><span style="color:#d88200">&#34;.StartPageActivity&#34;</span><span style="color:#f92672">&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;androidx.recyclerview.widget.RecyclerView</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75af00">android:id=</span><span style="color:#d88200">&#34;@+id/recycler&#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75af00">android:layout_width=</span><span style="color:#d88200">&#34;match_parent&#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75af00">android:layout_height=</span><span style="color:#d88200">&#34;match_parent&#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75af00">app:layoutManager=</span><span style="color:#d88200">&#34;com.google.android.material.carousel.CarouselLayoutManager&#34;</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;/LinearLayout&gt;</span>
</span></span></code></pre></div><p>carousel_start_page.xml</p>
<p>material.carousel 1.9.0 没什么东西可用，这里就对展示的内容（ConstraintLayout包裹）进行了布局</p>
<ul>
<li>Guideline 实现百分比分割</li>
<li>TextView textSize改（alt+回车-&gt;Extract dimension resource）硬编码为引用dimens.xml（res/values/dimens.xml）</li>
<li>ImageView layout_width和layout_height设置0dp，实现Guideline范围内保持比例的缩放</li>
</ul>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#75715e">&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;com.google.android.material.carousel.MaskableFrameLayout</span> 
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">xmlns:android=</span><span style="color:#d88200">&#34;http://schemas.android.com/apk/res/android&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">xmlns:app=</span><span style="color:#d88200">&#34;http://schemas.android.com/apk/res-auto&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">xmlns:tools=</span><span style="color:#d88200">&#34;http://schemas.android.com/tools&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">android:id=</span><span style="color:#d88200">&#34;@+id/carousel_start_page&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">android:layout_width=</span><span style="color:#d88200">&#34;match_parent&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">android:layout_height=</span><span style="color:#d88200">&#34;match_parent&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">android:layout_marginEnd=</span><span style="color:#d88200">&#34;10dp&#34;</span><span style="color:#f92672">&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;androidx.constraintlayout.widget.ConstraintLayout</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75af00">android:id=</span><span style="color:#d88200">&#34;@+id/list_item&#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75af00">android:layout_width=</span><span style="color:#d88200">&#34;match_parent&#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75af00">android:layout_height=</span><span style="color:#d88200">&#34;match_parent&#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75af00">android:background=</span><span style="color:#d88200">&#34;@color/white&#34;</span><span style="color:#f92672">&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;androidx.constraintlayout.widget.Guideline</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:id=</span><span style="color:#d88200">&#34;@+id/guideline1&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_width=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_height=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:orientation=</span><span style="color:#d88200">&#34;horizontal&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintGuide_percent=</span><span style="color:#d88200">&#34;0.1&#34;</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;TextView</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:id=</span><span style="color:#d88200">&#34;@+id/item_name&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_width=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_height=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:textColor=</span><span style="color:#d88200">&#34;@color/teal_200&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:textSize=</span><span style="color:#d88200">&#34;@dimen/start_page_item_name&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintBottom_toTopOf=</span><span style="color:#d88200">&#34;@id/guideline1&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintEnd_toEndOf=</span><span style="color:#d88200">&#34;parent&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintStart_toStartOf=</span><span style="color:#d88200">&#34;parent&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintTop_toTopOf=</span><span style="color:#d88200">&#34;@id/guideline1&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">tools:text=</span><span style="color:#d88200">&#34;平面&#34;</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;androidx.constraintlayout.widget.Guideline</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:id=</span><span style="color:#d88200">&#34;@+id/guideline2_1&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_width=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_height=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:orientation=</span><span style="color:#d88200">&#34;horizontal&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintGuide_percent=</span><span style="color:#d88200">&#34;0.2&#34;</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;ImageView</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:id=</span><span style="color:#d88200">&#34;@+id/item_image&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_width=</span><span style="color:#d88200">&#34;0dp&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_height=</span><span style="color:#d88200">&#34;0dp&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:contentDescription=</span><span style="color:#d88200">&#34;@string/ui_model_schematic_diagram&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintBottom_toTopOf=</span><span style="color:#d88200">&#34;@id/guideline2_2&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintEnd_toEndOf=</span><span style="color:#d88200">&#34;parent&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintStart_toStartOf=</span><span style="color:#d88200">&#34;parent&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintTop_toTopOf=</span><span style="color:#d88200">&#34;@id/guideline2_1&#34;</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;androidx.constraintlayout.widget.Guideline</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:id=</span><span style="color:#d88200">&#34;@+id/guideline2_2&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_width=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_height=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:orientation=</span><span style="color:#d88200">&#34;horizontal&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintGuide_percent=</span><span style="color:#d88200">&#34;0.8&#34;</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;androidx.constraintlayout.widget.Guideline</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:id=</span><span style="color:#d88200">&#34;@+id/guideline3&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_width=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_height=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:orientation=</span><span style="color:#d88200">&#34;horizontal&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintGuide_percent=</span><span style="color:#d88200">&#34;0.9&#34;</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;Button</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:id=</span><span style="color:#d88200">&#34;@+id/item_enter&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">style=</span><span style="color:#d88200">&#34;@style/Widget.Material3.Button.ElevatedButton&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_width=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:layout_height=</span><span style="color:#d88200">&#34;wrap_content&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">android:text=</span><span style="color:#d88200">&#34;@string/enter&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintBottom_toTopOf=</span><span style="color:#d88200">&#34;@id/guideline3&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintEnd_toEndOf=</span><span style="color:#d88200">&#34;parent&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintStart_toStartOf=</span><span style="color:#d88200">&#34;parent&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#75af00">app:layout_constraintTop_toTopOf=</span><span style="color:#d88200">&#34;@id/guideline3&#34;</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;/com.google.android.material.carousel.MaskableFrameLayout&gt;</span>
</span></span></code></pre></div><h2 id="新增应用-theme">新增+应用 theme</h2>
<p>themes.xml</p>
<p>设置全屏</p>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#75715e">&lt;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;resources&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">&lt;!-- 启动 --&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;style</span> <span style="color:#75af00">name=</span><span style="color:#d88200">&#34;Theme.HCollection.Launcher&#34;</span> <span style="color:#75af00">parent=</span><span style="color:#d88200">&#34;Theme.Material3.DayNight.NoActionBar&#34;</span><span style="color:#f92672">&gt;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;item</span> <span style="color:#75af00">name=</span><span style="color:#d88200">&#34;android:windowFullscreen&#34;</span><span style="color:#f92672">&gt;</span>true<span style="color:#f92672">&lt;/item&gt;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;item</span> <span style="color:#75af00">name=</span><span style="color:#d88200">&#34;android:windowContentOverlay&#34;</span><span style="color:#f92672">&gt;</span>@null<span style="color:#f92672">&lt;/item&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;/style&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">&lt;!-- 通用 --&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;style</span> <span style="color:#75af00">name=</span><span style="color:#d88200">&#34;Theme.HCollection&#34;</span> <span style="color:#75af00">parent=</span><span style="color:#d88200">&#34;Theme.Material3.DayNight.NoActionBar&#34;</span><span style="color:#f92672">&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;/style&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;/resources&gt;</span>
</span></span></code></pre></div><p>AndroidManifest.xml</p>
<p>应用全屏</p>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-xml" data-lang="xml"><span style="display:flex;"><span><span style="color:#f92672">&lt;activity</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">android:name=</span><span style="color:#d88200">&#34;.StartPageActivity&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">android:exported=</span><span style="color:#d88200">&#34;true&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">android:theme=</span><span style="color:#d88200">&#34;@style/Theme.HCollection.Launcher&#34;</span> <span style="color:#f92672">&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;intent-filter&gt;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;action</span> <span style="color:#75af00">android:name=</span><span style="color:#d88200">&#34;android.intent.action.MAIN&#34;</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#f92672">&lt;category</span> <span style="color:#75af00">android:name=</span><span style="color:#d88200">&#34;android.intent.category.LAUNCHER&#34;</span> <span style="color:#f92672">/&gt;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&lt;/intent-filter&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;/activity&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;activity</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">android:name=</span><span style="color:#d88200">&#34;.MainActivity&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75af00">android:exported=</span><span style="color:#d88200">&#34;true&#34;</span> <span style="color:#f92672">&gt;</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">&lt;/activity&gt;</span>
</span></span></code></pre></div><h2 id="创建-recyclerview-逻辑">创建 RecyclerView 逻辑</h2>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-kotlin" data-lang="kotlin"><span style="display:flex;"><span><span style="color:#00a8c8">package</span> <span style="color:#111">com.hcindy.hcollection.adapter</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">data</span> <span style="color:#00a8c8">class</span> <span style="color:#75af00">StartPageDataSet</span><span style="color:#111">(</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">val</span> <span style="color:#111">name</span><span style="color:#111">:</span> <span style="color:#111">String</span><span style="color:#111">,</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">val</span> <span style="color:#111">image</span><span style="color:#111">:</span> <span style="color:#111">Int</span>
</span></span><span style="display:flex;"><span><span style="color:#111">)</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-kotlin" data-lang="kotlin"><span style="display:flex;"><span><span style="color:#00a8c8">package</span> <span style="color:#111">com.hcindy.hcollection.adapter</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">import</span> <span style="color:#111">android.view.LayoutInflater</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">import</span> <span style="color:#111">android.view.View</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">import</span> <span style="color:#111">android.view.ViewGroup</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">import</span> <span style="color:#111">android.widget.Button</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">import</span> <span style="color:#111">android.widget.ImageView</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">import</span> <span style="color:#111">android.widget.TextView</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">import</span> <span style="color:#111">androidx.constraintlayout.widget.ConstraintLayout</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">import</span> <span style="color:#111">androidx.recyclerview.widget.RecyclerView</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">import</span> <span style="color:#111">com.hcindy.hcollection.R</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">class</span> <span style="color:#75af00">StartPageAdapter</span><span style="color:#111">(</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">val</span> <span style="color:#111">dataSet</span><span style="color:#111">:</span> <span style="color:#111">Array</span><span style="color:#111">&lt;</span><span style="color:#111">StartPageDataSet</span><span style="color:#111">&gt;,</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">private</span> <span style="color:#00a8c8">val</span> <span style="color:#111">listener</span><span style="color:#111">:</span> <span style="color:#111">OnItemClickListener</span>
</span></span><span style="display:flex;"><span><span style="color:#111">)</span> <span style="color:#111">:</span> <span style="color:#75af00">RecyclerView</span><span style="color:#111">.</span><span style="color:#111">Adapter</span><span style="color:#111">&lt;</span><span style="color:#75af00">StartPageAdapter</span><span style="color:#111">.</span><span style="color:#111">ViewHolder</span><span style="color:#111">&gt;()</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">interface</span> <span style="color:#75af00">OnItemClickListener</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">fun</span> <span style="color:#75af00">onItemClick</span><span style="color:#111">(</span><span style="color:#111">position</span><span style="color:#111">:</span> <span style="color:#111">Int</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">inner</span> <span style="color:#00a8c8">class</span> <span style="color:#75af00">ViewHolder</span><span style="color:#111">(</span><span style="color:#111">view</span><span style="color:#111">:</span> <span style="color:#111">View</span><span style="color:#111">)</span> <span style="color:#111">:</span> <span style="color:#75af00">RecyclerView</span><span style="color:#111">.</span><span style="color:#111">ViewHolder</span><span style="color:#111">(</span><span style="color:#111">view</span><span style="color:#111">),</span> <span style="color:#75af00">View</span><span style="color:#111">.</span><span style="color:#111">OnClickListener</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">val</span> <span style="color:#111">layout</span><span style="color:#111">:</span> <span style="color:#111">ConstraintLayout</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">val</span> <span style="color:#111">nameView</span><span style="color:#111">:</span> <span style="color:#111">TextView</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">val</span> <span style="color:#111">imageView</span><span style="color:#111">:</span> <span style="color:#111">ImageView</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">val</span> <span style="color:#111">enterView</span><span style="color:#111">:</span> <span style="color:#111">Button</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">init</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">layout</span> <span style="color:#111">=</span> <span style="color:#111">view</span><span style="color:#111">.</span><span style="color:#111">findViewById</span><span style="color:#111">(</span><span style="color:#75af00">R</span><span style="color:#111">.</span><span style="color:#111">id</span><span style="color:#111">.</span><span style="color:#111">list_item</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">nameView</span> <span style="color:#111">=</span> <span style="color:#111">layout</span><span style="color:#111">.</span><span style="color:#111">findViewById</span><span style="color:#111">(</span><span style="color:#75af00">R</span><span style="color:#111">.</span><span style="color:#111">id</span><span style="color:#111">.</span><span style="color:#111">item_name</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">imageView</span> <span style="color:#111">=</span> <span style="color:#111">layout</span><span style="color:#111">.</span><span style="color:#111">findViewById</span><span style="color:#111">(</span><span style="color:#75af00">R</span><span style="color:#111">.</span><span style="color:#111">id</span><span style="color:#111">.</span><span style="color:#111">item_image</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">enterView</span> <span style="color:#111">=</span> <span style="color:#111">layout</span><span style="color:#111">.</span><span style="color:#111">findViewById</span><span style="color:#111">(</span><span style="color:#75af00">R</span><span style="color:#111">.</span><span style="color:#111">id</span><span style="color:#111">.</span><span style="color:#111">item_enter</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">enterView</span><span style="color:#111">.</span><span style="color:#111">setOnClickListener</span><span style="color:#111">(</span><span style="color:#00a8c8">this</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">override</span> <span style="color:#00a8c8">fun</span> <span style="color:#75af00">onClick</span><span style="color:#111">(</span><span style="color:#111">view</span><span style="color:#111">:</span> <span style="color:#111">View</span><span style="color:#111">)</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">listener</span><span style="color:#111">.</span><span style="color:#111">onItemClick</span><span style="color:#111">(</span><span style="color:#111">adapterPosition</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// Create new views (invoked by the layout manager)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#00a8c8">override</span> <span style="color:#00a8c8">fun</span> <span style="color:#75af00">onCreateViewHolder</span><span style="color:#111">(</span><span style="color:#111">viewGroup</span><span style="color:#111">:</span> <span style="color:#111">ViewGroup</span><span style="color:#111">,</span> <span style="color:#111">viewType</span><span style="color:#111">:</span> <span style="color:#111">Int</span><span style="color:#111">):</span> <span style="color:#111">ViewHolder</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// Create a new view, which defines the UI of the list item
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>        <span style="color:#00a8c8">val</span> <span style="color:#111">view</span> <span style="color:#111">=</span> <span style="color:#75af00">LayoutInflater</span><span style="color:#111">.</span><span style="color:#111">from</span><span style="color:#111">(</span><span style="color:#111">viewGroup</span><span style="color:#111">.</span><span style="color:#111">context</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">.</span><span style="color:#111">inflate</span><span style="color:#111">(</span><span style="color:#75af00">R</span><span style="color:#111">.</span><span style="color:#111">layout</span><span style="color:#111">.</span><span style="color:#111">carousel_start_page</span><span style="color:#111">,</span> <span style="color:#111">viewGroup</span><span style="color:#111">,</span> <span style="color:#00a8c8">false</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">return</span> <span style="color:#111">ViewHolder</span><span style="color:#111">(</span><span style="color:#111">view</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// Replace the contents of a view (invoked by the layout manager)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#00a8c8">override</span> <span style="color:#00a8c8">fun</span> <span style="color:#75af00">onBindViewHolder</span><span style="color:#111">(</span><span style="color:#111">viewHolder</span><span style="color:#111">:</span> <span style="color:#111">ViewHolder</span><span style="color:#111">,</span> <span style="color:#111">position</span><span style="color:#111">:</span> <span style="color:#111">Int</span><span style="color:#111">)</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// Get element from your dataset at this position and replace the
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>        <span style="color:#75715e">// contents of the view with that element
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>        <span style="color:#111">viewHolder</span><span style="color:#111">.</span><span style="color:#111">nameView</span><span style="color:#111">.</span><span style="color:#111">text</span> <span style="color:#111">=</span> <span style="color:#111">dataSet</span><span style="color:#111">[</span><span style="color:#111">position</span><span style="color:#111">].</span><span style="color:#111">name</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">viewHolder</span><span style="color:#111">.</span><span style="color:#111">imageView</span><span style="color:#111">.</span><span style="color:#111">setImageResource</span><span style="color:#111">(</span><span style="color:#111">dataSet</span><span style="color:#111">[</span><span style="color:#111">position</span><span style="color:#111">].</span><span style="color:#111">image</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// Return the size of your dataset (invoked by the layout manager)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#00a8c8">override</span> <span style="color:#00a8c8">fun</span> <span style="color:#75af00">getItemCount</span><span style="color:#111">()</span> <span style="color:#111">=</span> <span style="color:#111">dataSet</span><span style="color:#111">.</span><span style="color:#111">size</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#111">}</span>
</span></span></code></pre></div><h2 id="补充-startpageactivity-逻辑">补充 StartPageActivity 逻辑</h2>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-kotlin" data-lang="kotlin"><span style="display:flex;"><span><span style="color:#75715e">// 接着setContentView后面写
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#111">findViewById</span><span style="color:#111">&lt;</span><span style="color:#111">RecyclerView</span><span style="color:#111">&gt;(</span><span style="color:#75af00">R</span><span style="color:#111">.</span><span style="color:#111">id</span><span style="color:#111">.</span><span style="color:#111">recycler</span><span style="color:#111">).</span><span style="color:#111">adapter</span> <span style="color:#111">=</span> <span style="color:#111">StartPageAdapter</span><span style="color:#111">(</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">arrayOf</span><span style="color:#111">(</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">StartPageDataSet</span><span style="color:#111">(</span><span style="color:#d88200">&#34;平面&#34;</span><span style="color:#111">,</span> <span style="color:#75af00">R</span><span style="color:#111">.</span><span style="color:#111">drawable</span><span style="color:#111">.</span><span style="color:#111">d2</span><span style="color:#111">),</span> <span style="color:#75715e">// 准备三张图片放到res/drawable下
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>        <span style="color:#111">StartPageDataSet</span><span style="color:#111">(</span><span style="color:#d88200">&#34;立体&#34;</span><span style="color:#111">,</span> <span style="color:#75af00">R</span><span style="color:#111">.</span><span style="color:#111">drawable</span><span style="color:#111">.</span><span style="color:#111">d3</span><span style="color:#111">),</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">StartPageDataSet</span><span style="color:#111">(</span><span style="color:#d88200">&#34;Web&#34;</span><span style="color:#111">,</span> <span style="color:#75af00">R</span><span style="color:#111">.</span><span style="color:#111">drawable</span><span style="color:#111">.</span><span style="color:#111">dw</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">),</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">object</span> <span style="color:#960050;background-color:#1e0010">: </span><span style="color:#75af00">StartPageAdapter</span><span style="color:#111">.</span><span style="color:#111">OnItemClickListener</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">override</span> <span style="color:#00a8c8">fun</span> <span style="color:#75af00">onItemClick</span><span style="color:#111">(</span><span style="color:#111">position</span><span style="color:#111">:</span> <span style="color:#111">Int</span><span style="color:#111">)</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>            <span style="color:#00a8c8">when</span> <span style="color:#111">(</span><span style="color:#111">position</span><span style="color:#111">)</span> <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>                <span style="color:#ae81ff">0</span> <span style="color:#f92672">-&gt;</span> <span style="color:#111">startActivity</span><span style="color:#111">(</span><span style="color:#111">Intent</span><span style="color:#111">(</span><span style="color:#00a8c8">this</span><span style="color:#75af00">@StartPageActivity</span><span style="color:#111">,</span> <span style="color:#111">MainActivity</span><span style="color:#f92672">::</span><span style="color:#00a8c8">class</span><span style="color:#111">.</span><span style="color:#111">java</span><span style="color:#111">))</span>
</span></span><span style="display:flex;"><span>                <span style="color:#ae81ff">1</span><span style="color:#111">,</span> <span style="color:#ae81ff">2</span> <span style="color:#f92672">-&gt;</span> <span style="color:#75af00">Toast</span><span style="color:#111">.</span><span style="color:#111">makeText</span><span style="color:#111">(</span><span style="color:#00a8c8">this</span><span style="color:#75af00">@StartPageActivity</span><span style="color:#111">,</span> <span style="color:#d88200">&#34;开发中&#34;</span><span style="color:#111">,</span> <span style="color:#75af00">Toast</span><span style="color:#111">.</span><span style="color:#111">LENGTH_SHORT</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>                    <span style="color:#111">.</span><span style="color:#111">show</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>                <span style="color:#00a8c8">else</span> <span style="color:#f92672">-&gt;</span> <span style="color:#75af00">Toast</span><span style="color:#111">.</span><span style="color:#111">makeText</span><span style="color:#111">(</span>
</span></span><span style="display:flex;"><span>                    <span style="color:#00a8c8">this</span><span style="color:#75af00">@StartPageActivity</span><span style="color:#111">,</span>
</span></span><span style="display:flex;"><span>                    <span style="color:#d88200">&#34;程序异常：选中模式代码</span><span style="color:#d88200">$position</span><span style="color:#d88200">&#34;</span><span style="color:#111">,</span>
</span></span><span style="display:flex;"><span>                    <span style="color:#75af00">Toast</span><span style="color:#111">.</span><span style="color:#111">LENGTH_SHORT</span>
</span></span><span style="display:flex;"><span>                <span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>                    <span style="color:#111">.</span><span style="color:#111">show</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span>            <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span><span style="color:#111">)</span>
</span></span></code></pre></div><h2 id="备注">备注</h2>
<p>以上仅为串通逻辑，后续迭代详见代码，除非基本逻辑有重大变更，否则不会继续记录</p>


    


                    
                    <div class="row"></div> 

                </div>

            </div> 

        </div> 
<script src="/lib/jquery.min.js"></script> 
<script src="/lib/popper.min.js"></script> 

<script src="/js/bootstrap.min.js"></script> 


<script type="text/javascript" src="/plugins/lunr.min.js"></script>
<script type="text/javascript" src="/plugins/auto-complete.js"></script>
<link href="/plugins/auto-complete.css" rel="stylesheet">
<script type="text/javascript">
  
      var baseurl = "\/";
  
</script>
<script type="text/javascript" src="/plugins/search.js"></script>

<script type="text/javascript" src="/plugins/favorites.js"></script>


<script type="text/javascript" src="/plugins/clipboard.js"></script>
<script>
  new ClipboardJS('.btn');
</script>
</body>
</html>
